#ifndef _RSS_CHANNEL_H
#define _RSS_CHANNEL_H

#include <string>
#include <ctime>
#include <list>
#include <map>

class RssItem;

class RssChannel
{
	typedef std::list<RssItem>::iterator iterator;
	typedef std::list<RssItem>::const_iterator const_iterator;
public:
	RssChannel();
	virtual ~RssChannel();

	std::string& operator[](const std::string &name);
	void set(const std::string &name, const std::string &value);
	std::string operator[](const std::string &name) const;
	std::string getValue(const std::string &name) const;
	int getTTL() const;
	time_t getPubDate() const;

	iterator begin();
	const_iterator begin() const;
	iterator end();
	const_iterator end() const;

	void addItem(const RssItem &item);
	size_t itemCount() const;

private:
	std::list<RssItem> m_items;
	std::map<std::string, std::string> m_name2value;
	int m_ttl;
	time_t m_pubDate;
};

#endif

